<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=utf-8" pageEncoding="utf-8"
	language="java"%>
<%@ include file="/jsp/platform/include/include.jsp"%>
<html>
<head>
<TITLE><c:out value="${_LOGONUSER_.MANAGETITILE}" />
</TITLE>
<META http-equiv="Content-Type" content="text/html; charset=utf-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge" />
	<%@ include file="/jsp/platform/include/header.jsp"%>

	<script type="text/javascript">
	        $(document).ready(function() {
	           //交易状态
	           <common:getDicListByKey key="2130" var="transStatusList"/>
	        })
	        function downloadHistoryOrderList(){
				$("#queryForm").attr("action","<%=request.getContextPath()%>/manage/ordLog/downloadHistoryOrderList");
				$('#queryForm').submit();
		        $("#queryForm").attr("action","<%=request.getContextPath()%>/manage/ordLog/historyOrderList");
			}
	</script>
</HEAD>
<BODY>
	<DIV class="all">
		<%@ include file="/jsp/platform/include/head.jsp"%>
		<%@ include file="/jsp/platform/include/menu.jsp"%>
		<DIV class="mains">
			<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
				<TBODY>
					<TR valign="top">
						<%@ include file="/jsp/platform/include/mainLeft.jsp"%>
						<TD>
							<TABLE width="100%" border="0" cellspacing="0" cellpadding="0">
								<TBODY>
									<TR>
										<TD>
											<TABLE width="180" border="0" cellspacing="0" cellpadding="0">
												<TBODY>
													<TR>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_l.jpg">
														</TD>
														<TD align="center"
															background="<%=request.getContextPath()%>/images/pages_bg.jpg">
															<SPAN class="f_tit1">历史交易查询</SPAN>
														</TD>
														<TD width="7"><IMG width="7" height="36" alt=""
															src="<%=request.getContextPath()%>/images/pages_r.jpg">
														</TD>
													</TR>
												</TBODY>
											</TABLE>
										</TD>
									</TR>
								</TBODY>
								<TR>
									<TD>
										<div class="pages_con">
											<FORM name="queryForm" id="queryForm"
												action="<%=request.getContextPath()%>/manage/ordLog/historyOrderList"
												method="post">
												<div class="pages_con_20">

													<div class="transaction_external">
														<DIV class="clearfix">
															<SPAN class="label dl_w"
																  style="padding-left:20px;text-align:right;">创建时间：</SPAN>
															<DIV class="select2 date">
																<INPUT name="beginDate" class="easyui-datebox"
																	   id="beginDate" style="border:none" type="text"
																	   data-options="formatter:myformatter,parser:myparser"
																	   value="${model.beginDate}">
															</DIV>
															<SPAN class="label margin_l_5">-</SPAN>
															<DIV class="select2 date">
																<INPUT name="endDate" class="easyui-datebox"
																	   id="endDate" style="border:none" type="text"
																	   data-options="formatter:myformatter,parser:myparser"
																	   value="${model.endDate}">
															</DIV>
															<SPAN class="label dl_w" style="padding-left:20px;text-align:right;">交易状态:</SPAN>
															<select id="transStatus" name="transStatus">
																<option value="">请选择</option>
																<c:forEach var="list" items="${transStatusList}">
																	<option value="${list.dirValue}"><c:out value='${list.dirCaption}'/></option>
																</c:forEach></select>

															<SPAN class="label dl_w" style="padding-left:20px;text-align:right;">交易类型:</SPAN>
															<select id="transType" name="transType">
																<option value="">交易类型</option>
																<option value="1001">扫码收款</option>
																<option value="1002">无卡收款</option>
																<option value="1003">刷卡收款</option>
																<option value="1004">线下扫码</option>
																<option value="1006">线上充值</option>
															</select>

															<SPAN class="fund-item"><SPAN class="label dl_w"
																 style="padding-left:20px;text-align:right;">商户账户：</SPAN>
																 <INPUT name="merSysAccount" id="merSysAccount"
																	   class="txtbox_cz txtbox_cz_long txtbox_cz_color input_change"
																	   type="text" maxlength="30" value="<c:out value='${model.merSysAccount}'/>"/></SPAN>
															<%--<SPAN
																class="fund-item"><SPAN class="label dl_w"
																	style="padding-left:20px;text-align:right;">终端SN：</SPAN>
																	<INPUT name="terminalId" id="terminalId"
																	class="txtbox_cz txtbox_cz_long txtbox_cz_color input_change"
																	type="text" maxlength="30" value="<c:out value='${model.terminalId}'/>"></INPUT></SPAN>--%>
														</DIV>

														<DIV class="clearfix">
															<SPAN class="fund-item"><SPAN class="label dl_w"
																                          style="padding-left: 20px; text-align: right;">商户名称：</SPAN>
															      <INPUT name="merchantName" id="merchantName"
																  class="txtbox_cz txtbox_cz_long txtbox_cz_color input_change"
																  type="text" maxlength="30" value="<c:out value='${model.merchantName}'/>">

															<SPAN class="fund-item"><SPAN class="label dl_w"
																						  style="padding-left:20px;text-align:right;">代理商名称：</SPAN>
                                                                  <INPUT name="agentName" id="agentName"
																		 class="txtbox_cz txtbox_cz_long txtbox_cz_color input_change"
																		 type="text" maxlength="30" value="<c:out value='${model.agentName}'/>"/>
														</DIV>
														<DIV class="clearfix">
																<SPAN
																			class="fund-item" style="padding-left:100px;"> <A
																				class="btn confirm margin_l_10"
																				onClick="$('#queryForm').submit();" href="javascript:void(0);">查询</A>
																		</SPAN>
																		<SPAN
																			class="fund-item"> <A
																				class="btn confirm margin_l_10"
																				onClick="downloadHistoryOrderList();" href="javascript:void(0);">下载</A>
																		</SPAN>
														</DIV>
													</DIV>
													<a style="color:black;text-decoration:none;margin-bottom:10px;">当前订单总记录数：<c:out value="${recordCount}"/></>笔，订单总额：<c:out value="${paymentAmt}"/>元。</a>
													<br>
														<div class="talbes">
															<table style="text-align: center" width="100%" border="0"
																cellpadding="8" cellspacing="0">
																<tbody>
																	<tr class="talbe_pubs_tr">
																		<td>创建时间</td>
																		<td>交易流水号</td>
																		<td>交易类型</td>
																		<td>订单金额</td>
																		<td>商户账户</td>
																		<td>商户名称</td>
																		<td>代理商名称</td>
																		<!-- <td>终端编号</td> -->
																		<td>收款订单号</td>
																		<!-- <td>结算订单号</td> -->
																		<td>交易状态</td>
																	    <!-- <td>结算状态</td> -->
																	</tr>
																	<c:forEach var="model" items="${list}">
																		<tr>
																			<td><fmt:formatDate value="${model.createDate}"
																					pattern="yyyy-MM-dd HH:mm:ss" /></td>
																			<td><c:out value="${model.ordId}" /></td>
																			<td>
																				<c:choose>
																					<c:when test="${model.transType == '1001'}">扫码支付-
																						<c:choose>
																							<c:when test="${model.paymentType == '1'}">支付宝</c:when>
																							<c:when test="${model.paymentType == '2'}">微信</c:when>
																							<c:otherwise>其他</c:otherwise>
																						</c:choose>																					
																					</c:when>
																					<c:when test="${model.transType == '1002'}">无卡支付-
																					    <c:choose>
																							<c:when test="${model.paymentType == 'yb'}">易宝支付</c:when>
																							<c:when test="${model.paymentType == 'jd'}">京东支付</c:when>
																							<c:when test="${model.paymentType == 'mb'}">摩宝支付</c:when>
																							<c:otherwise>其他</c:otherwise>
																						</c:choose>
																					</c:when>
																					<c:when test="${model.transType == '1003'}">刷卡支付</c:when>
																					<c:when test="${model.transType == '1004'}">线下扫码
																						<c:choose>
																							<c:when test="${model.paymentType == '1'}">支付宝</c:when>
																							<c:when test="${model.paymentType == '2'}">微信</c:when>
																							<c:otherwise>其他</c:otherwise>
																						</c:choose>
																					</c:when>
																					<c:when test="${model.transType == '1006'}">线上充值
																						<c:choose>
																							<c:when test="${model.paymentType == '1'}">支付宝</c:when>
																							<c:when test="${model.paymentType == '2'}">微信</c:when>
																							<c:otherwise>其他</c:otherwise>
																						</c:choose>		</c:when>
																					<c:otherwise></c:otherwise>
																				</c:choose>
																			</td>
																			<td><fmt:formatNumber pattern="#,##0.00" value="${model.paymentAmt}"/>
																			</td>
																			<td><c:out value="${model.merSysAccount}" /></td>
																			<td><common:GetAccounNameByIdELTag key="${model.merchantId}" /></td>
																			<td><common:GetAccounNameByIdELTag key="${model.agentId}" /></td>
																			<%-- <td><c:out value="${model.terminalId}" /></td> --%>
																			<td><c:out value="${model.paymentId}" /></td>
																			<%-- <td><c:out value="${model.settleOrdId}" /></td> --%>
																			<td><common:getDicByCode key="2130" value="${model.transStatus}"/></td>
																			<%-- <td><common:getDicByCode key="2020" value="${model.settleStatus}"/></td> --%>
																		</tr>
																	</c:forEach>
																</tbody>
															</table>
															<jsp:include page="/jsp/platform/include/kkpager.jsp"></jsp:include>
														</div>
												</div>
											</FORM>
										</div> <!--当中内容块结束-->
									</TD>
								</TR>
							</TABLE>
						</TD>
					</TR>
				</TBODY>
			</TABLE>
		</DIV>
		<%@ include file="/jsp/platform/include/foot.jsp"%>
		<script type="text/javascript">
		       $("#transStatus").val("<c:out value='${model.transStatus}'/>");
		       $("#transType").val("<c:out value='${model.transType}'/>");    
		</script>
</BODY>
</HTML>
